.PHONY: clean all

EXES = btchecktime btchecktime_orig
DBG_EXES = $(foreach exe, $(EXES), $(exe)_dbg)
LIBS = $(shell root-config --libs)
CCFLAGS = -O2 -I$(shell root-config --incdir)
DBG_CCFLAGS = -g -I$(shell root-config --incdir)

all: $(EXES) dbg
dbg: $(DBG_EXES)

#% :: %.o
#	g++ -g -o $@ $(shell root-config --libs) $^

% :: %.cpp
	g++ $(CCFLAGS) -o $@ $< $(LIBS)

%_dbg: %.cpp
	g++ $(DBG_CCFLAGS) -o $@ $< $(LIBS)

install: $(EXES) $(DBG_EXES)
	/usr/bin/install $^ $(BELLEMY)/beamtest/bin


clean:
	rm -f *.o $(EXES) $(DBG_EXES)



#SOURCES = $(foreach exe, $(EXES), $(exe).cpp)
